//
//  AppManager.m
//  App
//
//  Created by gome on 2018/11/27.
//  Copyright © 2018 gome. All rights reserved.
//

#import "AppManager.h"
#import "AppDelegate.h"
#import "HomeViewController.h"
#import "LoginViewController.h"
#import "GuidViewController.h"

#import "AppUserManger.h"
#import "AppLoginManager.h"

#define AppDelegateInstence ((AppDelegate *)[((UIApplication *)[UIApplication sharedApplication]) delegate])
#define AppMainWindow AppDelegateInstence.window

@implementation AppManager

/**
 appManager 单例方法

 @return app实例
 */
+ (instancetype)sharedInstance {
    static AppManager *____staticAppManager;
    static dispatch_once_t ____onceToken;
    
    dispatch_once(&____onceToken, ^{
        ____staticAppManager = [[AppManager alloc] init];
    });
    
    return ____staticAppManager;
}

- (void)setUpApp {
//    推送 设置
//    第三方 sdk 设置
}


/**
 显示首页
 */
- (void)showHomePage {
    dispatch_async(dispatch_get_main_queue(), ^{
        AppDelegateInstence.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]];;
    });
}

- (void)showLoginPage {
    dispatch_async(dispatch_get_main_queue(), ^{
        AppDelegateInstence.window.rootViewController = [[LoginViewController alloc] init];
    });
}

- (void)showGuidPage {
    AppDelegateInstence.window.rootViewController = [[GuidViewController alloc] init];
}

- (void)preShow {
//    app 新版 大版 显示guid
//    app 是否 隐式登陆
//
}
@end
